/*
 * Copyright (c) 2007-2021 西安交通信息投资营运有限公司 版权所有
 */

package com.xci.xajtfb.wxc.api;

import com.github.lvyanyang.annotation.Authorize;
import com.github.lvyanyang.core.BaseController;
import com.github.lvyanyang.core.BoolResult;
import com.github.lvyanyang.core.Const;
import com.github.lvyanyang.core.PageList;
import com.github.lvyanyang.core.XCI;
import com.xci.xajtfb.wxc.entity.SchCoach;
import com.xci.xajtfb.wxc.filter.SchCoachFilter;
import com.xci.xajtfb.wxc.service.SchCoachService;
import com.github.lvyanyang.model.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperationSupport;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 教练员基本资料表接口
 * @author 马星俊 maxingjun@xci96716.com
 * @since 2021-03-01 17:39:46
 */
@Api(tags = "教练员基本资料表接口")
@Authorize
@RestController
@RequestMapping(value = "/api/wxc/schCoach", produces = Const.PROJSON)
public class SchCoachApiController extends BaseController {
    /** 教练员基本资料表服务 */
    @Resource private SchCoachService schCoachService;

    @ApiOperationSupport(order = 7)
    @ApiOperation(value = "根据主键查询单个教练员基本资料表")
    //@Authorize(code = "wxc.schCoach.select")
    @PostMapping("/selectById")
    public BoolResult<SchCoach> selectById(@RequestBody IdBody body) {
        return BoolResult.success(schCoachService.selectById(body.getId()));
    }

    @ApiOperationSupport(order = 9)
    @ApiOperation(value = "查询教练员基本资料表分页列表")
    //@Authorize(code = "wxc.schCoach.select")
    @PostMapping("/selectPageList")
    public BoolResult<PageList<SchCoach>> selectPageList(@RequestBody SchCoachFilter filter) {
        return BoolResult.success(schCoachService.selectPageList(filter));
    }
}